package com.campus.server.service;

import com.campus.common.vo.Teacher;
import com.campus.server.dao.TeacherAccountManagementDao;
import com.campus.server.dao.TeacherDao;

import java.util.List;

public class TeacherAccountManagementService {
    private TeacherAccountManagementDao teacherAccountManagementDao = new TeacherAccountManagementDao();
    private TeacherDao teacherDao = new TeacherDao();

    public List<Teacher> listTeachers() {
        return teacherAccountManagementDao.listAllTeachers();
    }

    public boolean addTeacher(Teacher teacher){return teacherDao.isRegister(teacher.getTeacherId(), "123456",teacher);}

    public boolean deleteTeacher(String teacherId) {return teacherAccountManagementDao.deleteTeacher(teacherId);}

    public Teacher getTeacherById(String teacherId) {return teacherAccountManagementDao.getTeacherById(teacherId);}

    public List<Teacher> searchTeachersByName(String name){return teacherAccountManagementDao.searchTeachersByName(name);}

    public List<Teacher> searchTeacherById(String teacherId){return teacherAccountManagementDao.searchTeachersById(teacherId);}

    public List<Teacher> searchTeachers(String teacherId, String name) {return teacherAccountManagementDao.searchTeachers(teacherId, name);}

    public boolean updateTeacher(Teacher teacher) {return teacherAccountManagementDao.updateTeacher(teacher);}

    public boolean teacherExists(String teacherId) {return teacherAccountManagementDao.teacherExists(teacherId);}
}
